// 分组表单
import { services } from '@/config'

export const groupOption = [
  {
    label: '资产信息',
    prop: 'ctiInfo',
    icon: 'el-icon-edit-outline',
    column: [
      {
        type: 'tree',
        label: '父资产名称',
        prop: 'parentId',
        dicUrl: `${services.assetService}fyassetassetcard/tree`,
        dicMethod: 'get',
        span: 12,
        props: { label: 'name', value: 'id' }
      },
      {
        label: '父资产编码',
        prop: 'parentNumber',
        addDisplay: false,
        span: 12,
        disabled: true
      },
      {
        label: '所属单位',
        prop: 'belongdeptId',
        type: 'tree',
        dicUrl: `${services.adminService}dept/tree`,
        dicMethod: 'get',
        span: 12,
        props: { label: 'name', value: 'id' },
        required: true,
        rules: [
          {
            required: true,
            message: '请选择所属单位'
          }
        ]
      },
      {
        type: 'tree',
        label: '存放地点',
        prop: 'locationId',
        span: 12,
        formslot: true,
        slot: true,
        hide: true,
        dicUrl: `${services.spaceService}fyroomposition/tree`,
        dicMethod: 'get',
        props: { label: 'name', value: 'id' }
      },
      {
        type: 'tree',
        label: '房间',
        prop: 'houseId',
        span: 12,
        hide: true,
        formslot: true,
        slot: true /*,
        props: {label: "name", value: "id"},
        dicUrl: "/house/fyroomhouse/tree",
        dicMethod: "get" */
      },
      {
        type: 'input',
        label: '存放全名称',
        prop: 'locationType',
        span: 12,
        hide: true
      }
    ]
  },
  {
    label: '基本信息',
    prop: 'jbxx',
    icon: 'el-icon-edit-outline',
    column: [
      {
        label: '标准型号',
        props: {
          label: 'name',
          value: 'id'
        },
        span: 12,
        prop: 'sauName',
        type: 'input',
        slot: true,
        formslot: true
      },
      {
        type: 'tree',
        label: '资产类别',
        prop: 'ctiId',
        dicUrl: `${services.assetService}fyassetcti/tree`,
        dicMethod: 'get',
        props: { label: 'name', value: 'id' },
        required: true,
        span: 12,
        rules: [
          {
            required: true,
            message: '请选择资产类别'
          }
        ]
      },
      {
        label: '资产编码',
        span: 12,
        prop: 'number'
      },
      {
        label: '资产名称',
        prop: 'name',
        required: true,
        span: 12,
        rules: [
          {
            required: true,
            message: '请输入资产名称'
          }
        ]
      },
      {
        label: '英文名称',
        span: 12,
        prop: 'enName'
      },
      {
        label: '资产别名',
        span: 12,
        prop: 'alias'
      },
      {
        label: '规格型号',
        prop: 'model',
        span: 12,
        required: true,
        rules: [
          {
            required: true,
            message: '请输入规格型号'
          }
        ]
      },
      {
        label: '计量单位',
        prop: 'unit',
        span: 12,
        required: true,
        rules: [
          {
            required: true,
            message: '请输入计量单位'
          }
        ]
      },
      {
        label: 'SN号',
        span: 12,
        prop: 'sn'
      },
      {
        label: '会计凭证号',
        span: 12,
        prop: 'voucherNo'
      },

      {
        label: '使用部门',
        prop: 'usedeptId',
        span: 12,
        type: 'tree',
        dicUrl: `${services.adminService}dept/tree`,
        dicMethod: 'get',
        props: { label: 'name', value: 'id' }
      },
      {
        label: '使用人',
        prop: 'useId',
        type: 'tree',
        span: 12,
        props: { label: 'name', value: 'id' },
        dicUrl: `${services.adminService}user/tree`,
        dicMethod: 'get'
      },
      {
        type: 'tree',
        label: '合 同 号',
        span: 12,
        prop: 'contractId',
        props: { label: 'name', value: 'id' },
        dicUrl: `${services.assetService}fyassetcontract/contractTree`,
        dicMethod: 'get'
      },
      {
        label: '原    值',
        prop: 'originalAmount',
        required: true,
        span: 12,
        rules: [
          {
            required: true,
            message: '请选择原值'
          }
        ]
      },
      {
        label: '累计折旧',
        span: 12,
        prop: 'depreciation'
      },
      {
        label: '金额',
        span: 12,
        prop: 'amount'
      },
      {
        type: 'select',
        label: '货币单位',
        span: 12,
        prop: 'monetaryUnit',
        dicUrl: `${services.adminService}dict/type/asset_currency_unit`,
        dicMethod: 'get',
        props: { label: 'label', value: 'value' },
        required: true,
        rules: [
          {
            required: true,
            message: '请选择货币单位'
          }
        ]
      },
      {
        type: 'select',
        label: '资产状态',
        span: 12,
        prop: 'status',
        dicUrl: `${services.adminService}dict/type/asset_status`,
        dicMethod: 'get',
        props: { label: 'label', value: 'value' },
        required: true,
        rules: [
          {
            required: true,
            message: '请选择资产状态'
          }
        ]
      }
    ]
  },
  {
    label: '供应商信息',
    prop: 'gyxx',
    icon: 'el-icon-edit-outline',
    column: [
      {
        type: 'tree',
        label: '生 产 厂',
        prop: 'makerId',
        span: 12,
        dicUrl: `${services.assetService}fyassetsupplier/tree`,
        dicMethod: 'get',
        props: { label: 'name', value: 'id' },
        dicQuery: { type: 'M' }
      },
      {
        type: 'tree',
        label: '供 应 商',
        prop: 'supplierId',
        span: 12,
        dicUrl: `${services.assetService}fyassetsupplier/tree`,
        dicMethod: 'get',
        props: { label: 'name', value: 'id' },
        dicQuery: { type: 'V' }
      },
      {
        label: '联系人',
        span: 12,
        prop: 'supplierUser'
      },
      {
        label: '联系电话',
        span: 12,
        prop: 'supplierPhone'
      },
      {
        label: '品牌',
        span: 12,
        prop: 'brand'
      },
      {
        label: '维保到期',
        prop: 'maintenanceDate',
        span: 12,
        type: 'date',
        format: 'yyyy-MM-dd',
        valueFormat: 'yyyy-MM-dd'
      },
      {
        label: '截止日期',
        prop: 'guaranteeDate',
        tip: '请填写保修截止日期',
        type: 'date',
        span: 12,
        format: 'yyyy-MM-dd',
        valueFormat: 'yyyy-MM-dd'
      },
      {
        label: '维保说明',
        prop: 'maintenanceInfo',
        type: 'textarea',
        span: 24
      }
    ]
  },
  {
    label: '生命周期时间',
    prop: 'smzqsj',
    icon: 'el-icon-edit-outline',
    column: [
      {
        label: '出厂日期',
        prop: 'factoryDate',
        type: 'date',
        span: 12,
        format: 'yyyy-MM-dd',
        valueFormat: 'yyyy-MM-dd'
      },
      {
        type: 'select',
        label: '来源',
        span: 12,
        prop: 'source',
        dicUrl: `${services.adminService}dict/type/asset_source`,
        dicMethod: 'get',
        props: { label: 'label', value: 'value' }
      },
      {
        label: '购入日期',
        prop: 'buyDate',
        span: 12,
        type: 'date',
        format: 'yyyy-MM-dd',
        valueFormat: 'yyyy-MM-dd',
        required: true,
        rules: [
          {
            required: true,
            message: '请输入购入日期'
          }
        ]
      },
      {
        label: '建档日期',
        prop: 'recordDate',
        type: 'date',
        span: 12,
        format: 'yyyy-MM-dd',
        valueFormat: 'yyyy-MM-dd'
      },
      {
        label: '取得日期',
        prop: 'acquireDate',
        span: 12,
        type: 'date',
        format: 'yyyy-MM-dd',
        valueFormat: 'yyyy-MM-dd'
      },
      {
        label: '始用日期',
        prop: 'useDate',
        span: 12,
        type: 'date',
        format: 'yyyy-MM-dd',
        valueFormat: 'yyyy-MM-dd'
      },
      {
        label: '使用期限',
        prop: 'usefulLife',
        append: '月',
        type: 'number',
        controls: true,
        span: 12,
        required: true,
        value: 0,
        rules: [
          {
            required: true,
            message: '请填写使用期限'
          }
        ]
      },
      {
        label: '报废日期',
        prop: 'scrapDate',
        type: 'date',
        span: 12,
        format: 'yyyy-MM-dd',
        valueFormat: 'yyyy-MM-dd'
      }
    ]
  },
  {
    label: '其它信息',
    prop: 'xtxx',
    icon: 'el-icon-edit-outline',
    column: [
      {
        type: 'select',
        label: '经费来源',
        prop: 'fundsSource',
        span: 12,
        dicUrl: `${services.adminService}dict/type/asset_source`,
        dicMethod: 'get',
        props: { label: 'label', value: 'value' },
        value: '01'
      },
      {
        type: 'select',
        label: '采购方式',
        prop: 'purchaseMode',
        span: 12,
        dicUrl: `${services.adminService}dict/type/asset_purchase_method`,
        dicMethod: 'get',
        props: { label: 'label', value: 'value' }
      },
      {
        label: '固定资产',
        prop: 'fixedAssets',
        value: '1',
        span: 12,
        type: 'radio',
        dicData: [
          {
            label: '否',
            value: '0'
          },
          {
            label: '是',
            value: '1'
          }
        ],
        display: true,
        props: {
          label: 'label',
          value: 'value'
        }
      },
      {
        type: 'select',
        label: '使用方式',
        span: 12,
        prop: 'usageOption',
        dicUrl: `${services.adminService}dict/type/asset_how_user`,
        dicMethod: 'get',
        props: { label: 'label', value: 'value' }
      },
      {
        type: 'input',
        label: '取得方式',
        span: 12,
        prop: 'acquireWay'
      },
      {
        type: 'textarea',
        label: '功能描述',
        prop: 'description',
        span: 24
      },
      {
        type: 'textarea',
        label: '备注',
        prop: 'remarks',
        span: 24
      },
      {
        label: '照片',
        prop: 'photo',
        type: 'upload',
        listType: 'picture-img',
        span: 24,
        height: 20,
        limit: 1,
        fileSize: 1024,
        propsHttp: {
          res: 'data'
        },
        tip: '只能上传jpg/png格式，且不超过1024kb',
        action: `${services.adminService}sys-file/upload`,
        hide: true
      }
    ]
  }
]

export const tableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  searchMenuspan: 12,
  addTitle: '资产信息管理',
  dialogWidth: 1280,
  viewBtn: true,
  column: [
    {
      type: 'input',
      label: '房间ID',
      prop: 'id',
      span: 12,
      display: false,
      hide: true
    },
    {
      type: 'input',
      label: '创建人ID',
      prop: 'createId',
      span: 12,
      display: false,
      hide: true
    },
    {
      type: 'input',
      label: '创建人所属OU的ID',
      prop: 'deptId',
      span: 12,
      display: false,
      hide: true
    },
    {
      type: 'input',
      label: '创建人所属OU的全称',
      prop: 'deptFullname',
      span: 12,
      display: false,
      hide: true
    },
    {
      type: 'input',
      label: '最后修改人信息',
      prop: 'updateBy',
      span: 12,
      display: false,
      hide: true
    },
    {
      type: 'input',
      label: '最后修改时间',
      prop: 'updateTime',
      span: 12,
      display: false,
      hide: true
    },
    /* {
      "type": "input",
      "label": "所属父类资产",
      "prop": "parentId",
      "span": 12,
      hide: true,
      display: false
    }, */
    {
      type: 'input',
      label: '父资产名称',
      prop: 'parentName',
      span: 12,
      display: false
    },
    {
      type: 'input',
      // 按照编码规则如果没填就自动生成（是资产一级分类的编码加上年度月度在加5位唯一码），
      // 如果填了就按客户填写的，前端做校验只能是数字和字母不能的汉子和特殊符号
      label: '资产编码',
      prop: 'number',
      span: 12,
      display: false,
      width: 145,
      search: true,
      searchOrder: 2
    },
    {
      type: 'input',
      label: '资产名称',
      prop: 'name',
      width: 145,
      span: 12,
      search: true,
      fixed: true,
      display: false,
      searchOrder: 3
    },
    {
      type: 'select',
      label: '资产状态', // 0{0：库存、1：在用、2：借用、3：维修中、4：调拨中、5：报废中、6：处置中、7：报废}
      prop: 'status',
      span: 12,
      value: '0',
      search: true,
      searchOrder: 1,
      dicUrl: `${services.adminService}dict/type/asset_status`,
      dicMethod: 'get',
      props: { label: 'label', value: 'value' },
      searchSpan: 4,
      display: false
    },
    {
      type: 'input',
      label: '资产类别',
      prop: 'ctiName',
      span: 12,
      display: false,
      search: true,
      searchOrder: 4,
      dicUrl: `${services.assetService}fyassetcti/tree`,
      dicMethod: 'get',
      props: { label: 'name', value: 'name' }
    },
    {
      type: 'input',
      label: '规格型号',
      prop: 'model',
      span: 12,
      display: false,
      width: 80,
      search: true,
      searchOrder: 5
    },
    {
      type: 'input',
      label: 'SN号',
      prop: 'sn',
      span: 12,
      display: false
    },
    {
      type: 'input',
      label: '计量单位',
      prop: 'unit',
      span: 12,
      display: false,
      search: true,
      searchOrder: 6
    },
    {
      type: 'number',
      label: '金额',
      prop: 'amount',
      span: 24,
      display: false,
      searchRange: true,
      searchOrder: 7
    },
    {
      type: 'number',
      label: '金额大于',
      prop: 'amountGt',
      span: 24,
      search: true,
      display: false,
      hide: true,
      searchOrder: 7
    },
    {
      type: 'number',
      label: '金额小于',
      prop: 'amountLt',
      span: 24,
      search: true,
      display: false,
      hide: true,
      searchOrder: 7
    },
    {
      type: 'input',
      label: '使用单位',
      prop: 'parentUseunitname',
      span: 12,
      hide: true,
      display: false
    },
    {
      type: 'input',
      label: '使用部门',
      prop: 'usedept',
      span: 12,
      display: false,
      search: true,
      searchOrder: 8
    },
    {
      type: 'input',
      label: '使用人',
      prop: 'useName',
      span: 12,
      display: false,
      search: true,
      searchOrder: 9
    },
    {
      type: 'input',
      label: '存放地点',
      prop: 'location',
      span: 12,
      display: false,
      width: 100,
      search: true,
      searchOrder: 10
    },
    {
      type: 'date',
      label: '购入日期',
      prop: 'buyDate',
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dd',
      span: 24,
      width: 90,
      display: false,
      search: true,
      searchRange: true,
      searchOrder: 11
    },
    {
      type: 'input',
      label: '供 应 商',
      prop: 'supplier',
      span: 12,
      display: false,
      search: true,
      searchOrder: 12
    },
    {
      type: 'input',
      label: '供应商联系人',
      prop: 'supplierUser',
      width: 110,
      span: 12,
      display: false
    },
    {
      type: 'input',
      label: '供应商联系电话',
      prop: 'supplierPhone',
      width: 110,
      span: 12,
      display: false
    },
    {
      type: 'input',
      label: '使用期限',
      prop: 'usefulLife',
      span: 24,
      append: '月',
      display: false,
      search: true,
      searchOrder: 13,
      searchRange: true
    },
    {
      type: 'input',
      label: '创建人',
      prop: 'createBy',
      hide: true,
      span: 12,
      display: false
    },
    {
      type: 'input',
      label: '创建时间',
      prop: 'createTime',
      hide: true,
      span: 12,
      display: false
    },
    {
      type: 'input',
      label: '资产编码',
      prop: 'parentNumber',
      span: 12,
      display: false,
      hide: true
    },
    {
      type: 'input',
      label: '型号名称',
      prop: 'sauName',
      formslot: true,
      span: 12,
      display: false
    },
    /* {
      "type": "input",
      "label": "资产类别ID",
      "prop": "ctiId",
      "span": 12,
      hide: true,
      display: false
    }, */

    {
      type: 'input',
      label: '资产类别全名称',
      prop: 'classified',
      span: 12,
      display: false,
      hide: true
    },

    {
      type: 'input',
      label: '资产类别全编码',
      prop: 'classifiedCode',
      span: 12,
      display: false,
      hide: true
    },
    {
      type: 'input',
      label: '英文名称',
      prop: 'enName',
      span: 12,
      display: false
    },
    {
      type: 'input',
      label: '资产别名',
      prop: 'alias',
      span: 12,
      display: false
    },

    {
      type: 'input',
      label: '会计凭证号',
      prop: 'voucherNo',
      width: 100,
      span: 12,
      display: false
    },
    {
      type: 'input',
      label: '所属单位全名称',
      prop: 'belongdeptFullname',
      span: 12,
      display: false,
      hide: true
    },
    /* {
      "type": "input",
      "label": "所属单位id",
      "prop": "belongdeptId",
      "span": 12,
      hide: true,
      display: false
    }, */
    {
      type: 'input',
      label: '所属单位',
      prop: 'belongdept',
      span: 12,
      display: false,
      search: true
    },
    /* {
      "type": "input",
      "label": "使用单位id",
      "prop": "usedeptId",
      "span": 12,
      hide: true,
      display: false
    }, */

    /*    {
          "type": "input",
          "label": "使用单位全名称",
          "prop": "usedeptFullname",
          "span": 12,
          display: false,
          hide: true
        }, */

    /* {
      "type": "input",
      "label": "使用人id",
      "prop": "useId",
      "span": 12,
      hide: true,
      display: false
    }, */

    {
      type: 'input',
      label: '存放地点类型',
      prop: 'locationType',
      span: 12,
      display: false,
      hide: true
    },
    {
      type: 'input',
      label: '合 同 号',
      prop: 'contractNumber',
      span: 12,
      display: false
    },
    /* {
      "type": "input",
      "label": "合 同 ID",
      "prop": "contractId",
      "span": 12,
      hide: true,
      display: false
    }, */
    {
      type: 'input',
      label: '原    值',
      prop: 'originalAmount',
      span: 12,
      display: false
    },
    {
      type: 'input',
      label: '累计折旧',
      prop: 'depreciation',
      span: 12,
      display: false
    },

    {
      type: 'input',
      label: '货币单位', // ：人民币：人民币：、欧元：欧元、美元：美元、法元：法元
      prop: 'monetaryUnit',
      span: 12,
      value: '人民币',
      display: false
    },

    {
      type: 'input',
      label: '生 产 厂',
      prop: 'maker',
      span: 12,
      display: false
    },
    /* {
      "type": "input",
      "label": "生 产 厂ID",
      "prop": "makerId",
      "span": 12,
      hide: true,
      display: false
    }, */

    /* {
      "type": "input",
      "label": "供 应 商ID",
      "prop": "supplierId",
      "span": 12,
      hide: true,
      display: false
    }, */
    {
      type: 'input',
      label: '品牌',
      prop: 'brand',
      span: 12,
      display: false
    },
    {
      type: 'input',
      label: '维保到期',
      prop: 'maintenanceDate',
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dd',
      width: 90,
      span: 12,
      display: false
    },
    {
      type: 'input',
      label: '维保说明',
      prop: 'maintenanceInfo',
      span: 12,
      hide: true,
      display: false
    },
    {
      type: 'input',
      label: '截止日期',
      prop: 'guaranteeDate',
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dd',
      width: 90,
      span: 12,
      display: false,
      labelTip: '请填写保修截止日期'
    },
    {
      type: 'input',
      label: '出厂日期',
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dd',
      prop: 'factoryDate',
      width: 90,
      span: 12,
      display: false
    },

    {
      type: 'input',
      label: '建档日期',
      prop: 'recordDate',
      width: 90,
      span: 12,
      display: false
    },
    {
      type: 'input',
      label: '取得日期',
      prop: 'acquireDate',
      width: 90,
      span: 12,
      display: false
    },
    {
      type: 'input',
      label: '始用日期',
      prop: 'useDate',
      width: 90,
      span: 12,
      display: false
    },

    {
      type: 'input',
      label: '报废日期',
      prop: 'scrapDate',
      width: 90,
      span: 12,
      display: false
    },
    {
      type: 'input',
      label: '经费来源',
      prop: 'fundsSource',
      span: 12,
      display: false
    },
    {
      label: '采购方式', // 01：邀标、02：自采:03：政府采购
      prop: 'purchaseMode',
      span: 12,
      display: false,
      type: 'select',
      dicUrl: `${services.adminService}dict/type/asset_purchase_method`,
      dicMethod: 'get',
      props: { label: 'label', value: 'value' }
    },
    {
      type: 'radio',
      label: '固定资产', // 0不是，1是，默认1
      prop: 'fixedAssets',
      value: '1',
      span: 12,
      dicData: [
        {
          label: '不是',
          value: '0'
        },
        {
          label: '是',
          value: '1'
        }
      ],
      display: false
    },
    {
      type: 'input',
      label: '取得方式',
      prop: 'acquireWay',
      span: 12,
      display: false
    },
    {
      type: 'input',
      label: '使用方式',
      prop: 'usageOption',
      span: 12,
      display: false
    },
    {
      type: 'input',
      label: '照片',
      prop: 'photo',
      hide: true,
      span: 12,
      display: false
    },
    {
      type: 'input',
      label: '功能描述',
      prop: 'description',
      span: 12,
      display: false
    },
    {
      type: 'textarea',
      label: '备注',
      prop: 'remarks',
      span: 24,
      display: false
    }
  ],
  group: groupOption
}
